package com.punch.common.dto.order;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * OrderDTO-订单信息 表单
 *
 * @author xiaol
 * @version 1.0.0
 * @since 2020/8/3
 */
@Data
public class OrderDetailDTO implements Serializable {

    /**
     * 产品类型 0-课程 1-教具/教材商品
     */
    @ApiModelProperty(name = "productType", notes = " 产品类型 0-课程 1-教具/教材商品")
    @NotNull(message = "产品类型为空")
    private Integer productType;


    /**
     * 产品id
     */
    @ApiModelProperty(name = "productId", notes = "产品id,有可能是课程班级id/教具id")
    @NotNull(message = "产品为空")
    private Long productId;

    /**
     * 产品名称
     */
    @ApiModelProperty(name = "productName", notes = "产品名称,有可能是课程班级名称/教具名称")
    @NotNull(message = "产品为空")
    private String productName;

    /**
     * 单价
     */
    @ApiModelProperty(name = "price", notes = "产品单价")
    @NotNull(message = "单价为空")
    @Min(value = 0, message = "单价不能为负数")
    private Integer price;

    /**
     * 原价
     */
    @ApiModelProperty(name = "originalPrice", notes = "产品原价")
    @NotNull(message = "原价为空")
    @Min(value = 0, message = "原价不能为负数")
    private Integer originalPrice;

    /**
     * 数量
     */
    @ApiModelProperty(name = "quantity", notes = "数量")
    @NotNull(message = "数量为空")
    @Min(value = 1, message = "数量不能小于1")
    private Integer quantity;

    /**
     * 小计金额
     */
    @ApiModelProperty(name = "totalAmount", notes = "小计金额")
    @NotNull(message = "小计金额为空")
    @Min(value = 0, message = "小计金额不能为负数")
    private Integer totalAmount;
}
